home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / mweb / MWEB Utils / ws295sdk.exe / Ws2sdkzp.exe / SAMPLES / WS2CHAT / QUEUE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-06  |  897 b   |  50 lines

  1. /*++
  2.  
  3. Copyright (c) 1995 Intel Corp
  4.  
  5. Module Name:
  6.  
  7.     queue.h
  8.  
  9. Abstract:
  10.  
  11.     Header file for the queue manager implemented by queue.c.
  12.  
  13. --*/
  14. #ifndef QUEUE_H
  15. #define QUEUE_H
  16.  
  17. #include "nowarn.h"  /* turn off benign warnings */
  18. #ifndef _WINSOCKAPI_
  19. #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
  20. #endif
  21. #include <windows.h>
  22. #include "nowarn.h"  /* some warnings may have been turned back on */
  23.  
  24.  
  25. #define ABNORMAL 1
  26. #define NORMAL 0
  27.  
  28. #define MAX_QUEUE_SIZE 1024
  29. #define Q_NULL -1
  30.  
  31.  
  32. typedef struct _QUEUE {
  33.  
  34.   LPVOID QueueArray[MAX_QUEUE_SIZE];
  35.   int Head;
  36.   int Tail;
  37.   CRITICAL_SECTION CrSec;
  38.  
  39. } QUEUE, *PQUEUE;
  40.  
  41.  
  42. PQUEUE QCreate(void);
  43. void QFree(PQUEUE Queue);
  44. BOOL QInsert(PQUEUE Queue, LPVOID Object);
  45. BOOL QInsertAtHead(PQUEUE Queue, LPVOID Object);
  46. LPVOID QRemove(PQUEUE Queue);
  47. BOOL QIsEmpty(PQUEUE Queue);
  48.  
  49. #endif
  50.